<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>1两秒之后变成bye world</title>
    <script src="./vue.js"></script>
</head>

<body>
    <!-- 原生 -->
    <!-- <div id="app">
    </div> -->
    <!-- vue -->
    <div id="app">
        {{msg}}
    </div>
    <script>
        // 原生
        // var dom = document.getElementById("app")
        // dom.innerHTML = 'hello world'
        // setTimeout(function () {
        //     dom.innerHTML = 'byle world'
        // }, 2000)

        // vue
        var app = new Vue({
            el: '#app',
            data: {
                msg: 'hello world'
            }
        })
        setTimeout(function () {
            app.$data.msg = 'bye world'
        }, 2000)
    </script>
</body>

</html>